package cn.luckdou.commons.utils;

public class MyJsdisUtil {
    public static String set(String key, Object object){
        try{
            JedisUtil.Strings strings = JedisUtil.getInstance().new Strings();
            byte[] bytes = SerializeUtil.serialize(object);
            String set = strings.set(key, bytes);
            return  set;
        }catch (Exception e){
            return null;
        }
    }


    public static Object get(String key){
        try{
            JedisUtil.Strings strings = JedisUtil.getInstance().new Strings();
            byte[] bytes = strings.get(key.getBytes());
            Object o = SerializeUtil.unserialize(bytes);
            return o;
        }catch (Exception e){
            return null;
        }
    }
}
